cmake_minimum_required(VERSION 3.10.2)
project(data_share)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "-std=c++1y -fno-rtti -fvisibility=default -D_GNU_SOURCE")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -fPIC -fpic -ffunction-sections -D_GLIBC_MOCK")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -ldl")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")
set(MOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../mock)
add_definitions(-DNAPI_EXPERIMENTAL)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/ data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/common/src data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/consumer/src data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/provider/src data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/proxy/src data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/common/src data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/dataShare/src data_share_src)
aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/observer/src data_share_src)
#aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/datashare_ext_ability data_share_src)
#aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/datashare_ext_ability_context data_share_src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/consumer/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/provider/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/native/proxy/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/dataShare/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/frameworks/js/napi/observer/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/common/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/consumer/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/inner_api/provider/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../utils_native/base/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../utils_native/safwk/native/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../relational_store/interfaces/inner_api/rdb/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../relational_store/interfaces/inner_api/appdatafwk/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../relational_store/interfaces/inner_api/dataability/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../kv_store/frameworks/common)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../datamgr_service/services/distributeddataservice/adapter/include/dfx)
include(${MOCK_DIR}/include/CMakeLists.txt OPTIONAL)

set(links secure mock relational_store)
add_library(data_share SHARED ${data_share_src})
target_link_libraries(data_share ${links})